package org.example;

import java.lang.reflect.Proxy;

public class ProxyApp {
    public static void main(String[] args) {
        MyService myService=new MyServiceImpl();
        MyHandler myHandler = new MyHandler(myService);
        MyService proxy =(MyService) Proxy.newProxyInstance(ProxyApp.class.getClassLoader(), new Class<?>[]{MyService.class},myHandler );
        String info = proxy.work("john");
        System.out.println("rs: "+(proxy instanceof Proxy));
    }
}
